{
  //声明函数
  function add(a: number, b: number): number{
    return a + b;
  }

  //表达式
  let minus = function(a: number, b: number): number{
    return a - b;
  }

  //箭头函数
  let time = (a: number, b: number) => {
    return a * b;
  }

  //声明除法函数
  let divide: (a: number, b: number) => number;
  divide = (x: number, y: number) => {
    return x / y;
  }

  //
  let pow: (a: number, b: number) => number = (x: number, y: number) => {
    return x ** y;
  }

  //截取  iloveyou
  // function slice(str: string, start: number, end ?: number){
  //   return str.slice(start, end);
  // }

  // // console.log(slice('iloveyou', 1, 5)); // slice()
  // console.log(slice('iloveyou', 1)); // slice()

  //函数参数的默认值 code 手机号  area 国家号
  // function buildPhone(code: string, area: string='+86'){
  //   return area + code;
  // }

  // console.log(buildPhone('15896352469', '+86'));
  // console.log(buildPhone('18965487235', '+250'));

  // rest 参数  splice()  push()   unshift   React.creatElement 
  // function jia(...args: number[]){
  //   console.log(args);
  // }

  function createElement(type: string, props: object, ...children: object[]){

  }
  createElement('h1', {a: 100}, {x: 100}, {y: 200})

  // console.log(jia(1,2,3,4,5));
  

}